import {Modal, View} from '@ant-design/react-native';
import React from 'react';

const NullNode = () => <View />;

const TModal = (
  title: string,
  confirm: (() => void | Promise<any>) | undefined,
  message: string | JSX.Element = NullNode(),
) => {
  Modal.alert(title, message, [
    {text: '取消', onPress: () => console.log('cancel'), style: 'cancel'},
    {text: '确定', onPress: confirm},
  ]);
};
export default TModal;
